package com.oa.service.impl;

import java.util.List;

import com.oa.dao.DeptDao;
import com.oa.entity.Dept;
import com.oa.service.DeptService;

public class DeptServiceImpl implements DeptService {

	private DeptDao deptDao;
	@Override
	public Integer saveDept(Dept dept) {
		int result  =deptDao.saveDept(dept);
		deleteDept(20); //子表有数据，外键约束
		return result;
	}

	@Override
	public Integer deleteDept(Integer id) {
		return deptDao.deleteDept(id);
	}

	@Override
	public Dept findById(Integer id) {
		return deptDao.findById(id);
	}

	@Override
	public List<Dept> findAll() {
		return deptDao.findAll();
	}

	public DeptDao getDeptDao() {
		return deptDao;
	}

	public void setDeptDao(DeptDao deptDao) {
		this.deptDao = deptDao;
	}

	
}
